home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
editor
/
flyerstopframe.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-12-22
|
6KB
|
192 lines
/* FlyerStopFrame.rexx Grabs frames on cue from GPI trigger for stop-action animation */
/* By Arnie Cachelin © 1992 NewTek Inc. */
/* 4.0 Flyer version by Bob Caron (Grue) © 1995 NewTek Inc. */
/*
This program will grab and save frames on cue from the GPI trigger.
Since the Toaster is waiting for GPI input most of the time, it will not
respond to anything else, which you may find annoying. You can easily
give your Toaster GPI pulses by attaching a spare mouse or joystick to
the second mouse port then clicking the button. You can also find long
joystick extender cables at places like Radio Shack.
To grab frames for a claymation of stop-motion style animation, setup your
camera and 'actors', hook up a GPI trigger, and start this script with
appropriate arguments. When your first frame is ready, hit the trigger
to grab and save it. The toaster will then go into an 'onionskin' mode
where the camera is half dissolved over the last frame for ease of
positioning the actors. When you hit the GPI again, the Toaster will leave
onionskin mode and grab the next frame, then return to onionskin mode.
For best results, watch out for stray shadows, or shadows from the sun which
will change over the course of your shoot.
*/
OPTIONS RESULTS
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call addlib("ToasterARexx.port" , 0)
call set_view(3)
call req_error("Flyer StopFrame V3.0 --- Create stop-frame animation as a Flyer clip.")
drive="FA0:"
clip="StopMotion"
num=1
do while exists(drive||clip||num)
num=num+1
end
rx startfilereq("Save Clip Where?",drive,clip||num)
exit=1
do while exit=1
file=queryfilereq()
if file=0 then call quit
if file~="" then exit=0
address command "c:wait 1"
end
if exists(file) then
if req_tell("Ok to append to that clip?")=0 then call quit
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
say pragma("D",path)
path=pragma("D","RAM:")
name=path||filenam
call req_error("Example: 150 frames = 5 seconds.")
count=0
do while(count<1)
count=req_number("Number Of Frames To Grab",150)
if count="CANCEL" then call quit()
if count=0 then call quit
end
startframe=0
call req_error("Note: HQ-5 selection will only work if HQ-5 is turned on in the options panel.")
compression=-1
buttons='000'
do while compression=-1
buttons=req_buttons("Choose Compression:",buttons,"HQ-5","Standard","Extended")
if buttons="CANCEL" then call quit
if buttons="100" then do
compression=3
end
if buttons="010" then do
compression=0
end
if buttons="001" then do
compression=1
end
end
call req_error("")
vidinput="-1"
buttons='1000'
do while vidinput="-1"
buttons=req_buttons("Choose Input:",buttons,"Main 1","Main 2","Main 3","Main 4")
if buttons="CANCEL" then call quit
if buttons="1000" then do
vidinput="001"
end
if buttons="0100" then do
vidinput="002"
end
if buttons="0010" then do
vidinput="003"
end
if buttons="0001" then do
vidinput="004"
end
end
if req_tell("Notice!","Make sure your GPI trigger is","connected to the 2nd mouse port.")=0 then call quit
call req_error("Note: Once you begin this process you can't abort without rebooting your machine.")
if req_tell("Click 'Continue' to begin.")=0 then call quit
call req_error("")
if ~exists("toaster:programs/flyer_support/c/setplaymode") then do
call req_tell("Error:","I am missing the program","'SetPlayMode' in your","Programs/Flyer_Support/c directory")
call quit()
end
if ~exists("toaster:programs/flyer_support/c/AppendFields") then do
call req_tell("Error:","I am missing the program","'AppendFields' in your","Programs/Flyer_Support/c directory")
call quit()
end
address command "toaster:programs/flyer_support/c/setplaymode 0 REC"
Switcher(TOSW) /* Go to Switcher screen */
Switcher(M||vidinput)
Switcher(P||vidinput)
Switcher(LVID)
Switcher(PDV1)
Switcher(M||vidinput)
Switcher(P||vidinput)
startframe=1
i=1
call req_open("Hit GPI trigger to grab current frame.")
call req_error("StopMotion: Current Frame ("||right(i,3,'0')||") Frames to go ("||((startframe+count)-1)-i||")")
Switcher(SGPI,POS) /* Set GPI trigger to positive (leading edge of pulse) */
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in for first frame */
Do i=startframe+1 to count
name2='"'||name||'"'
address command "toaster:programs/flyer_support/c/appendfields "||name2||" 2 "compression" >env:output"
open(state, "env:output", R)
null=readln(state)
if left(readln(state),8)="Error 33" then do
address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
call req_error("")
call req_close()
call req_tell("Error:"," Your flyer drive is Full!")
call quit()
end
call close state
Switcher(FVID) /* Freeze frame */
Switcher(P||vidinput)
Switcher(MDV1)
Switcher(TBAR,255)
call req_error("StopMotion: Current Frame ("||i||") Frames to go ("||((startframe+count)-1)-i||")")
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in */
Switcher(TAKE)
Switcher(LVID) /* Set to live digital video */
Switcher(PDV1)
Switcher(P||vidinput)
end
address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
call req_close()
call req_error()
icontime=REQ_FLYERJOG("Choose frame for icon.",name,1)
if icontime="CANCEL" then call quit
icontime=icontime*2
call MAKEICON(name,icontime)
call req_error("All done.")
call req_error("")
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
exit
quit: PROCEDURE
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit